<%@ include file="makecon.jsp" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script type="text/javascript">
function validate()
{
var form =document.register
if(form.coursename.value=="")
{
alert("Course Name is Required");
form.coursename.value="";
form.coursename.focus();
return false;
}
var exp= /^[a-zA-Z]+$/;

 if(!form.coursename.value.match(exp))
{
alert("enter charactors only");
form.coursename.value="";
form.coursename.focus();
return false;
}


else if(form.noofseats.value=="")
{
alert("No.of Seats is Required");
form.noofseats.value="";
form.noofseats.focus();
return false;
}  
var exp= /^[0-9]+$/;

 if(!form.noofseats.value.match(exp))
{
alert("enter numbers only");
form.noofseats.value="";
form.noofseats.focus();
return false;
}


else if(form.duration.value=="")
{
alert("Course duration is Required");
form.duration.value="";
form.duration.focus();

return false;
}  
else if(form.feedet.value=="")
{
alert("feedetails are Required");
form.feedet.value="";
form.feedet.focus();
return false;
}  
var exp= /^[0-9]+$/;

 if(!form.feedet.value.match(exp))
{
alert("enter numbers only");
form.feedet.value="";
form.feedet.focus();
return false;
}
else if(form.coursestdate.value=="")
{
alert("Course starting date is Required");
form.coursestdate.value="";
form.coursestdate.focus();
return false;
}  

return true;
}
</script>

<TITLE></TITLE>
</HEAD>
<BODY background="images/17.jpg">
<form action="edu_Addcourse.jsp" method=post name="register" onsubmit="return validate()">

<%!  	
	ResultSet rsuni = null;
	ResultSet rscol=null;
	ResultSet rscourse = null;
%>
<%! String strr;%> 
<%! int univid,unid,colid,courseid;%>

<%
	Statement corscolst=con.createStatement();
	String cmd="Select * from collage_det";
	rscol=corscolst.executeQuery(cmd);
%><br>
<H4>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select The 
College:-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <SELECT id=select1 
name=collegeid style="HEIGHT: 22px; WIDTH: 129px"> 
<%	
	int val1=0;
	String val2=null;
	while(rscol.next())
	{
		val1=rscol.getInt(1);
		val2=rscol.getString(3);
	%>
		<option value='<%=val1%>'><%=val2%></option>");
<%}%>
</SELECT></H4>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</P>

<TABLE border=0ss cellPadding=1 cellSpacing=1 
style="HEIGHT: 34px; LEFT: 240px; POSITION: absolute; TOP: 100px; WIDTH: 200px; Z-INDEX: 101" width="75%">
  
  <TR>
    <TD><FONT color=purple size=5><STRONG>Course Details 
  </STRONG></FONT></TD>
  </TR></TABLE>

  <% try
	{
	Statement coursedet=con.createStatement();
 	rscourse=coursedet.executeQuery("select max(courseid) from course_det");
	if(rscourse.next())
		{
		courseid=rscourse.getInt(1)+1;
		System.out.println("Max course id:"+courseid);
		
		}
	else
		{
	  	courseid=500;
		System.out.println("Max course id:"+courseid);
		}
}catch(Exception e){System.out.println("Exception..."+e);}
%>
<br>
<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%" style="HEIGHT: 130px; LEFT: 204px; POSITION: absolute; TOP: 150px; WIDTH: 319px; Z-INDEX: 111">
  <TBODY>
  <TR>
    <TD>
      <P><FONT color=darkred><STRONG>Course Id</STRONG></FONT></P></TD>
    <TD><INPUT id=text8 name=courseid value="<%=courseid%>" readonly="readonly"></TD></TR>
  <TR>
    <TD>
      <P><FONT color=darkred><STRONG>Course Name</STRONG></FONT></P></TD>
    <TD><INPUT id=text9 name=coursename></TD></TR>
  <TR>
    <TD><FONT color=darkred><STRONG>
      <P><FONT color=darkred><STRONG>No of&nbsp; 
      Seat</STRONG></FONT></P></STRONG></FONT></TD>
    <TD><INPUT id=text10 name=noofseats></TD></TR>
  <TR>
    <TD><FONT color=darkred><STRONG><FONT 
      color=darkred><STRONG>Duration&nbsp;of&nbsp;Course in years</STRONG></FONT></STRONG></FONT></TD>
    <TD><INPUT id=text11 name=duration></TD></TR>
  <TR>
    <TD><FONT color=darkred><STRONG><FONT color=darkred><STRONG>Fees 
      Details</STRONG></FONT></STRONG></FONT></TD>
    <TD><INPUT id=text12 name=feedet></TD></TR>
  <TR>
    <TD><FONT color=darkred><STRONG><FONT color=darkred><STRONG>Course 
      Starting Date (dd/mm/yyyy)</STRONG></FONT></STRONG></FONT></TD>
    <TD><INPUT id=text13 name=coursestdate></TD></TR>
  <TR>
    <TD> </TD>
    <TD></TD></TR>
    
    </TBODY></TABLE>
	<p><br>
	  <br>
	 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input  align="left" id=submit1 name=submit1 style="LEFT: 243px; POSITION: absolute; TOP: 350px; Z-INDEX: 112" type=submit value=Submit>
<INPUT align="left" id=reset1 name=reset1 style="LEFT: 358px; POSITION: absolute; TOP: 350px; Z-INDEX: 113" type=reset value=Reset>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><br><br><br><br><br><br><br><br><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A href="edu_test.htm" target=right><STRONG>Back</STRONG></A>
</p>
	